<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../node_modules/vue/dist/vue.js"></script>

</head>

<body>
    <div id="app" ref="app1">{{student.name}}
        <com :a="a" @func="getSonmsg"></com>
        <div></div>
        
    </div>
    <!--v-show= display: none;  -->
    <script>
        var com={
            template:'<div><div @click="aaa">{{a}}</div></div>',
            data() {
                return {
                    msg:'sonmsg41654515'
                }
            },
            props:["a"],
            methods: {
                aaa(){
                    this.$emit('func',this.msg)
                }
            },

        }
       
        var vm = new Vue({
            el: "#app",
            data() {
                return {
                   a:100,
                   b:200,

                   bool:true,
                   student:{
                       name:'zs',
                       ager:18
                   },
                   fromsonmgs:''
                }
            },
            components:{
                com
            },
            methods: {
                getSonmsg(sonmsg){
                    this.fromsonmgs=sonmsg
                }
            },
           

        })
        
    </script>
</body>

</html>